import { createApp } from "vue"
import App from "./App.vue"
import router from "./router"
import store from "./store"
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

// 忽略 ResizeObserver 警告
const ignoreResizeObserverErr = (err: any) => {
  if (
    err instanceof Error &&
    err.message &&
    err.message.includes('ResizeObserver loop completed with undelivered notifications')
  ) {
    return
  }
  throw err
}
window.addEventListener('error', (event) => ignoreResizeObserverErr(event.error))
window.addEventListener('unhandledrejection', (event) => ignoreResizeObserverErr(event.reason))

const app = createApp(App)
app.use(store)
app.use(router)
app.use(ElementPlus)
app.mount('#app')
